home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: dd.chalmers.se!news.chalmers.se!sunic!EU.net!howland.reston.ans.net!xlink.net!uni-heidelberg!rz.uni-karlsruhe.de!stepsun.uni-kl.de!uklirb!feck
- From: feck@informatik.uni-kl.de (Christoph Feck IRZ)
- Subject: Re: How to detach from cli.
- Message-ID: <1994Feb17.165346@informatik.uni-kl.de>
- Sender: news@uklirb.informatik.uni-kl.de (Unix-News-System)
- Nntp-Posting-Host: uklirb.informatik.uni-kl.de
- Organization: University of Kaiserslautern, Germany
- References: <80d.ANN@yaps.dinoco.de> <1994Feb8.193709@informatik.uni-kl.de> <1994Feb8.110410.22728@dmu.ac.uk> <19940209145315.M.F.C.vdnHout@sp0099.kub.nl> <19940216211004.M.F.C.vdnHout@sp0002.kub.nl>
- Date: Thu, 17 Feb 1994 15:53:46 GMT
- Lines: 37
-
- In article <19940216211004.M.F.C.vdnHout@sp0002.kub.nl>, M.F.C.vdnHout@kub.nl (Marco van den Hout) writes:
- > "feck@informatik.uni-kl.de (Christoph Feck IRZ)" says about detaching:
- >
- > 1) clear the cli_module pointer... okay that's easy.. that prevents the
- > program to be unloaded when it exits..
- > 2) start a process (using CreateNewProc) with the same seglist and a
- > different entry point...
- >
- > This I don't get - RKRM Includes & Autodocs says NP_SegList and
- > NP_Entry are mutually exclusive.. then how can you use the same
- > seglist while starting at another entry point? Only way I see is to
- > check if the program was already started at the beginning..
-
- Either:
- Use NP_Entry. Send the new process a startup message
- (to pr_MsgPort). In this message place a pointer to the
- seglist. The called task can free this seglist later.
- Be sure to exit the calling task only after you got an 'OK'
- reply from the detached task. If your program isn't going
- to be 'resident' (reentrant), you can avoid all the message
- passing and just store the segment pointer in a variable,
- which is referenced via A4. The entry function must then
- use __saveds of course.
-
- Or:
- In the non-reentrant case, you can use NP_SegList, and check
- a global variable first (like you suggested).
-
- > By the way, I'm trying to program this in assembler, not in C.
-
- That doesn't matter :)
-
- Ciao,
- Christoph
-
- 3k// Christoph Feck, TowerSystems
- \X/ Amiga - Intuition inside.
-